package com.glela.common.util;

/**
 *业务编码生产器
 * @author liujie
 *
 */
public class BizNoGenerator {
	/**
	 * 虚拟币领取交易前缀
	 */
	public static String INTETRAL_RECIVE_TRAN_PREFIX = "3000";
	
	/**
	 * 虚拟币扣除编码前缀
	 */
	public static String INTETRAL_DEDUCT_TRAN_PREFIX = "4000";
	
	/**虚拟币领取流水号
	 * @return
	 */
	public synchronized static String generatorReviceInteralReturnTransactionNo(){
		String transactionNo = 	CryptUtils.getUUID();
		/*transactionNo = INTETRAL_RECIVE_TRAN_PREFIX+transactionNo;
		transactionNo = 	transactionNo.substring(0,32);*/

		return transactionNo;
	}
	/**虚拟币扣除流水号
	 * @return
	 */
	public synchronized static String generatorDeductInteralReturnTransactionNo(){
		String transactionNo = 	CryptUtils.getUUID();
		/*transactionNo = INTETRAL_DEDUCT_TRAN_PREFIX+transactionNo;
		transactionNo = 	transactionNo.substring(0,32);*/

		return transactionNo;
	}
	
	public static void main(String[] args){
		
		/*String tokenDes =  new String(CryptUtils.aesCbcDecrypt(CryptUtils.deriveAesKey("00:00:36"),
				CryptUtils.hex2byte("9D34FA751E8B2D2010CEB06610C6478B9BC30EDD8A06CCA2FA74FEE27F760050".getBytes())));
		*/
 
	//	System.out.println("====解密之后的兑换码[0]=====" + tokenDes);
		String tmp = generatorDeductInteralReturnTransactionNo();
		System.out.println(tmp.length());
		
		
 		tmp = generatorReviceInteralReturnTransactionNo();
		System.out.println(tmp);
	}
}
